package site.lanmushan.framework.configure.mvc.serializers;

import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;
import com.alibaba.fastjson.serializer.SerializeWriter;

import java.io.IOException;
import java.lang.reflect.Type;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author Administrator
 */
public class ToStringSerializer implements ObjectSerializer {


    public static final ToStringSerializer instance = new ToStringSerializer();
    @Override
    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType,
                      int features) throws IOException {
        SerializeWriter out = serializer.out;
        String strVal = null;

            strVal = object.toString();

        out.writeString(strVal);
    }

}
